﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="list.aspx.vb" Inherits="Assignment_2___Prototype.list" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    &nbsp;
    <td width="10%">
        <a href="../RSS.aspx"><img class="RSSlogo" src="../Images/rss.gif" /></a>
    </td>

    <asp:GridView ID="GridView1" runat="server" AllowSorting="True" 
        AutoGenerateColumns="False" DataSourceID="SqlDataSource1" 
        Width="738px" CssClass="transparent"  
    PagerStyle-CssClass="pgr"  
    AlternatingRowStyle-CssClass="alt" Height="181px" AllowPaging="True" 
        BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" 
        CellPadding="3" HorizontalAlign="Center" PageSize="4">
<AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>
        <Columns>
            <asp:BoundField DataField="CarModel" HeaderText="Model" 
                SortExpression="CarModel" >
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            </asp:BoundField>
            <asp:BoundField DataField="CarType" HeaderText="Type" 
                SortExpression="CarType" >
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            </asp:BoundField>
            <asp:BoundField DataField="CarColour" HeaderText="Colour" 
                SortExpression="CarColour" >
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            </asp:BoundField>
            <asp:BoundField DataField="CarYear" HeaderText="Year" 
                SortExpression="CarYear" >
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            </asp:BoundField>
           <%-- <asp:TemplateField HeaderText="Picture">
              <ItemTemplate>
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("CarID", "~/Details.aspx?CarID={0}") %>'>
                    <asp:Image Height="200px" Width="150px" ID="Image1" runat="server" ImageUrl='<%# Eval("Picture") %>' />
                    </asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>--%>
            <asp:TemplateField HeaderText="Picture">
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLink10" runat="server" NavigateUrl='<%# Eval("CarID", "~/Details.aspx?CarID={0}") %>'>
                    <asp:Image CssClass="carImage"  ID="Image1" runat="server" ImageUrl='<%# Eval("Picture") %>' />
                    </asp:HyperLink>
                </ItemTemplate>
                <%--<EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Eval("Picture") %>'></asp:TextBox>
                </EditItemTemplate>--%>
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            </asp:TemplateField>
        </Columns>

        <FooterStyle BackColor="White" ForeColor="#000066" Font-Size="Large" />
        <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />

        <PagerSettings Position="TopAndBottom" />

<PagerStyle CssClass="pgr" BackColor="White" ForeColor="#000066" HorizontalAlign="Left" 
            Font-Bold="True" Font-Size="Large" Font-Underline="False"></PagerStyle>
        <RowStyle ForeColor="#000066" />
        <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
        <SortedAscendingCellStyle BackColor="#F1F1F1" />
        <SortedAscendingHeaderStyle BackColor="#007DBB" />
        <SortedDescendingCellStyle BackColor="#CAC9C9" />
        <SortedDescendingHeaderStyle BackColor="#00547E" />
</asp:GridView>

    <asp:Button ID="Button1" runat="server" Text="New Car" CssClass="buttons" 
        Height="35px" Width="110px"/>

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
        
    
        
        SelectCommand="SELECT [CarModel], [CarType], [CarColour], [CarYear], [Picture], [CarID] FROM [Car]"></asp:SqlDataSource>
</asp:Content>
